package icu.sehnen.servlet;

import icu.sehnen.dao.MemberStyleDao;
import icu.sehnen.model.CompanyModel;
import icu.sehnen.model.MemberModel;
import icu.sehnen.model.MemberStyleModel;
import icu.sehnen.model.NavModel;
import icu.sehnen.service.CompanyService;
import icu.sehnen.service.MemberService;
import icu.sehnen.service.MemberStyleService;
import icu.sehnen.service.NavService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/about")
public class AboutServlet extends HttpServlet {



    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    //公司信息
        CompanyService companyService=new CompanyService();
        CompanyModel companyModel=companyService.getCompannModelForAbout();
        req.setAttribute("companyModel",companyModel);

    //菜单栏信息
        NavService navService=new NavService();
        List<NavModel> navModelList=navService.getNavModelListForAbout();
        req.setAttribute("navModelList",navModelList);
    //      会员信息
        MemberService memberService=new MemberService();
        List<MemberModel> memberModelList=memberService.getMemberListForAbout();
        req.setAttribute("memberModelList",memberModelList);
//会员风采
        MemberStyleService memberStyleService=new MemberStyleService();
        List<MemberStyleModel> memberStyleModelList=memberStyleService.getMemberStyleForAbout();
        req.setAttribute("memberStyleModelList",memberStyleModelList);
        req.getRequestDispatcher("/jsp/about.jsp").forward(req,resp);
    }
}
